<script setup>
import ModifiableInput from './ModifiableInput.vue';
import { ref } from 'vue';

const props = defineProps(['isOpenModal'])
const emit = defineEmits(['update:isOpenModal'])

function closeModal() {
    emit('update:isOpenModal', false)
}


const user = {phone: ref(''), email: ref(''), password: ref('')}

</script>

<template>
    <div class="info-modification-modal" :class="{open: props.isOpenModal}" >
        <div class="content" >
            <div class="header" >
                <img src="/src/assets/images/student/close.svg" alt="Delete" @click="closeModal" />

            </div>
            <div class="main" >
                <p style="font-size: 22px; letter-spacing: 2px;" >超级管理员账户修改</p>
                <div class="card" >
                    <div class="avatar" >
                        <img src="/src/assets/images/student/avatar.svg" alt="Avatar">
                        <p>Name</p>
                    </div>
                    <div class="form" style="margin-left: 25px;" >
                        <ModifiableInput  type="text" placeholder="请输入手机号码" title="手机" v-model="user.phone.value" />
                        <ModifiableInput  type="text" placeholder="请输入邮箱" title="邮箱" v-model="user.email.value" />
                        <ModifiableInput  type="password" placeholder="请输入密码" title="密码" v-model="user.password.value" />
                    </div>
                </div>
            </div>
            <div class="footer" >
                <div class="button" style="background-color: #707070;" >取消</div>
                <div class="button" >确定</div>
            </div>
        </div>
    </div>

</template>

<style scoped >
.info-modification-modal {
    display: none;
    width: 100%;
    height: 100%;
    position: fixed;
    top: 0;
    right: 0;
    background-color: rgba(0, 0, 0, 0.5);
    overflow: auto;
    z-index: 15;
}

.info-modification-modal.open {
    display: flex;
    justify-content: center;
    align-items: start;
}

.info-modification-modal>.content {
    width: 800px;
    background-color: #ffffff;
    border: none;
    box-shadow: 0px 3px 6px 0px rgba(0, 0, 0, 0.16);
    padding: 20px 50px;
    margin-top: 35px;
}

.info-modification-modal>.content>.header {
    display: flex;
    justify-content: end;
    align-items: center;
    margin-bottom: 30px;
}

.content>.header>img {
    cursor: pointer;
    user-select: none;
    transition: transform 0.3s;
}

.content>.header>img:hover {
    transform: rotate(90deg);
}

.content>.main {
    text-align: center;
    margin-bottom: 20px;
}

.content>.main>p {
    font-family: Source Han Sans CN;
    color: #707070;
    font-size: 20px;
    font-weight: bold;
    line-height: 30px;
    margin-bottom: 20px;
}

.content>.main>.card {
    display: flex;
    justify-content: center;
    align-items: stretch;
}

.main>.card>.avatar {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.card>.avatar>p {
    font-family: Source Han Sans CN;
	font-size: 20px;
	font-weight: bold;
	line-height: 20px;
	color: #707070;
}

.main>.card>.form {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    align-items: start;
}

.main>.card>.form>div {
    margin: 10px 0;
}

.content > .footer {
    display: flex;
    justify-content: space-around;
    align-items: center;
} 

.content > .footer > .button {
    width: 160px;
	height: 40px;
	background-color: #8493a6;
	box-shadow: 0px 3px 6px 0px 
		rgba(0, 0, 0, 0.16);
    border: none;
    border-radius: 6px;
    font-family: Source Han Sans CN;
	font-size: 20px;
	line-height: 28px;
	color: #ffffff;
    text-align: center;
    padding: 6px 0;
    user-select: none;
    cursor: pointer;
    opacity: 1;
}

.content > .footer > .button:hover {
    opacity: 0.85;
}

.content > .footer > .button:active {
    transform: translateY(8px);
}

</style>